import pygame

class Ship():
	"""docstring for ClassName"""
	def __init__(self, screen):
		super(Ship, self).__init__()
		self.screen = screen

		self.image = pygame.image.load('images/ship.png')
		self.rect = self.image.get_rect()
		self.screen_rect = screen.get_rect()

		self.rect.centerx = self.screen_rect.centerx
		self.rect.bottom = self.screen_rect.bottom

		self.move_right = False
		self.move_left = False


	def blitme(self):
		self.screen.blit(self.image,self.rect)

	'''船移动'''
	def move(self,settings):
		#向右移动
		if self.move_right and self.rect.right<=self.screen_rect.right:
			self.rect.centerx += settings.ship_move_speed
			#移动标志改为false
			#self.move_right = False
		#向左移动
		if self.move_left and self.rect.left>0:
			self.rect.centerx -= settings.ship_move_speed
			#移动标志改为false
			#self.move_left = False

